package com.gxc.controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * servlet.
 *
 * @author 宫新程
 * @since 2018/12/18 6:33 PM
 */
public class TestServlet extends HttpServlet {

  @Override
  protected void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    super.doPost(req, resp);
  }

  @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    String name = request.getParameter("name");
    System.out.println(name);

    String path = request.getServletContext().getContextPath() + "/templates/test1.html";
    request.getRequestDispatcher(path).forward(request, response);
  }
}
